import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import {findById} from '../services/student'

export const useStudentStore = defineStore('student',() => {
    const student = ref({});
    const updateVisible = ref(false);
    function setUpdateVisible(visible){
        updateVisible.value = visible;
    }
    async function fetchStudent(id){
        let data = await findById(id);
        student.value = data;
    }
    return {student,updateVisible,setUpdateVisible,fetchStudent}
});